<!-- <?php
  session_start();
  if(!$_SESSION)
  {
    ?> 
     <script type="text/javascript">
     alert("Identifiquese"); 
     window.location="../Index.php";
     </script>
    <?php
 
  }
  


 ?> -->
<!DOCTYPE html>
<html>
  <head>
    <title>Usuarios</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
    <script type="text/javascript" src="js/bootstrap-tab.js"></script>
    <script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap-tab.js"></script>
    <script src="js/jquery.min.js">
    </script>
    <script type="text/javascript">

    $(document).ready(function(){
       $("#combobusqueda").hide();
        $("#textbusqueda").hide();
        $("#btnbusqueda").hide();
      $("#busqueda").click(function(){
        $("#combobusqueda").toggle();
        $("#textbusqueda").toggle();
        $("#btnbusqueda").toggle();

      });
    });
    
</script>
  </head>
  <body>
        <script src="http://code.jquery.com/jquery.js"></script>
        <script src="js/bootstrap.min.js"></script>
        
          <nav class="navbar-wrapper navbar-default navbar-fixed-top" role="navigation">
            <div class="collapse navbar-collapse navbar-ex1-collapse">
              <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                       <li><a href="ViewHome.php"><span class="glyphicon glyphicon-home"></span> Inicio</a></li>

                  <li><a href="ViewCarreras.php"><span class="glyphicon glyphicon-lock"></span> Carreras</a></li>

                  
                  <li class="dropdown">
                    <a href="ViewPerfiles.php" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-list-alt"></span> Perfiles</a>
                   <ul class="dropdown-menu" >
                    <li><a href="View_PA.php"><span class="glyphicon glyphicon-bookmark"></span> Perfil Acad&eacute;mico</a></li>
                    <li class="active"><a href="View_C.php"><span class="glyphicon glyphicon-book"></span> Perfil Curso</a></li>
                    <li><a href="#presupuesto" data-toggle="tab"><span class="glyphicon glyphicon-briefcase"></span> Perfil Presupuestarios</a></li> 
                  </ul>
                  </li>

                  <li class="active"><a href="ViewUsuarios.php"><span class="glyphicon glyphicon-user"></span> Usuarios</a></li>

                  <li><a href=""><span class="glyphicon glyphicon-calendar"></span> Horarios</a></li>

                  <li><a href=""><span class="glyphicon glyphicon-comment"></span> Reportes</a></li>

                  <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-asterisk"></span>
                      <ul class="dropdown-menu">
                        <li><a href="cerrarSesion.php">Salir</a></li>
                      </ul>
                    </li>
                  </ul>
            </div>
          </nav>
          <!--
          Se usa la de abajo para meter todo los forms.
          !-->
          <div class="container-fluid">
            <div class="jumbotron">
              
              <center>
                 <h3><p class="text-info"><span class="glyphicon glyphicon-user"></span>Lista de Usuarios.</p></h3>
                  
              </center>

               <a align="right" href="ViewUsuarios.php"><span class="glyphicon glyphicon-plus"></span> Nuevo Usuario</a>
               <br> 
               <a id="busqueda"><span class="glyphicon glyphicon-search"></span> Busqueda avanzada</a>
            <center>  
              <!--Form de busqueda-->

             <form action=''>
               <div class="input-append">
                <select class="form-control" id="combobusqueda" name="V_combo_busqueda" style="width: 200px; padding: 2px">
                  <option disabled>Buscar por</option>
                  <option>C&eacute;dula</option>
                  <option>Tipo</option>
                </select>
                  <input type="text" id="textbusqueda" class="form-control" name="V_text_busqueda" style="width: 200px; padding: 2px" x-webkit-speech>
                  <button id="btnbusqueda" type="button" class="btn btn-info">Buscar</button><input  type='hidden' value='1' name='Us_Buscar' /> 
                  <br>
                  
               </div>
              </form>
             <div class="input-group">
   
              <?php 
              require('ModelConexion.php');
              

              echo '<table border=1 class="table table-striped">'; 
              echo "<tr>"; 
              echo "<td><b>C&eacute;dula</b></td>"; 
              echo "<td><b>Tipo</b></td>"; 
              echo "<td><b>Fecha de Creaci&oacute;n</b></td>"; 
              echo "<td><b>Acciones</b></td>"; 
              echo "</tr>";   
              //Objetos
              //$usuario->Us_Buscar();
              $conexion = new Conexion();
              $consulta = $conexion->Consulta("
              SELECT * FROM paus ORDER BY fechacreacion DESC LIMIT 5
              ");
            
             

              if($conexion->numero_filas($consulta) > 0)
              { 
                while ($Busca_Us= $conexion->Arreglo($consulta))
                {
                  echo "<tr>"; 
                  echo "<td valign='top'>" .( $Busca_Us['cedula']) . "</td>"; 
                  echo "<td valign='top'>" .( $Busca_Us['tipo']) . "</td>";
                  echo "<td valign='top'>" .( $Busca_Us['fechacreacion']) . "</td>";
                  echo "<td valign='top'><a href=View_Us_Modificar.php?cedula=$Busca_Us[cedula]><span class='glyphicon glyphicon-edit'> </a>
                  <a href=View_Us_Eliminar.php?cedula={$Busca_Us['cedula']}> <span aling=right class='glyphicon glyphicon-remove-sign'> </a></td> "; 
                  echo "</tr>"; 
                }
              }
            
              ?>

              </tr>
              </table>
              <ul class="pager">
                <li class="previous disabled"><a href="#">&larr; Mas Nuevo</a></li>
                <li class="next"><a href="#">Mas Antiguo &rarr;</a></li>
              </ul>
            </div>

              </center>
            </div>
          </div> 
 

          <footer>
            <div class="container">
              <div class="row">
                <div class="col-md-10">&copy; 2013 | Universidad Nacional | Sede Regional Chrotega | Campus Nicoya</div>
               
              </div>
            </div>
          </footer>
      
  
  
  </body>
</html>